﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChangePassword.aspx.cs" Inherits="Web.Account.ChangePassword" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <link rel="stylesheet" type="text/css" href="../CSS/style.css" />
        <link rel="stylesheet" type="text/css" href="../CSS/bootstrap.min.css" />
        <link rel="stylesheet" type="text/css" href="../CSS/jquery-ui.css" />
        <link href="../CSS/Fonts.css" rel='stylesheet' type='text/css' />
        <script src="../JS/jquery.min.js"></script>
        <script src="../JS/bootstrap.min.js"></script>
        <script src="../JS/verify.notify.min.js"></script>
        <script src="../JS/jquery-ui.min.js"></script>
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                $.verify.addRules({
                    ConPassWordValidate: function (w) {
                        var value = w.val();
                        var ConPassvalidate = document.getElementById('<%= txtConfirmPasswordValidate.ClientID %>');
                        if ($('#txtConfirmPassword').val() != $('#txtPassword').val()) {
                            ConPassvalidate.value = null;
                            return "Does not match !";
                        }
                        ConPassvalidate.value = "ConfirmPassword";
                        return true;
                    }
                });
                function WebForm_OnSubmit() {
                    if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
                        $("#validation_dialog").dialog({
                            title: "Validation Error!",
                            modal: true,
                            resizable: false,
                            buttons: {
                                Close: function () {
                                    $(this).dialog('close');
                                }
                            }
                        });
                        return false;
                    }
                    return true;
                }
                function onClose() {
                    window.close();
                }
                function closeWin() {
                    alert("Change password successful !");
                    GetRadWindow().BrowserWindow.location.href = 'Users.aspx';
                    GetRadWindow().close();
                }
                function GetRadWindow() {
                    var oWindow = null;
                    if (window.radWindow)
                        oWindow = window.radWindow;
                    else if (window.frameElement.radWindow)
                        oWindow = window.frameElement.radWindow;
                    return oWindow;
                }
            </script>
        </telerik:RadCodeBlock>
        <div>
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
            <div class="container-fluid" style="padding: 0; margin: 40px">
                <div class="row">
                    <div class="edit-form highlight form-change" style="margin-bottom: 0">
                        <div class="control-group">
                            <div class="col-md-4 distance-control">
                                <div class="col-md-5">
                                    <label class="control-label">New Password </label>
                                </div>
                                <div class="col-md-5" style="background: #fff none repeat scroll 0 0; padding-top: 6px; padding-bottom: 6px">
                                    <div class="controls">
                                        <asp:TextBox ID="txtPassword" runat="server" class="form-control" type="password" data-validate="required" ClientIDMode="Static" />
                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" Display="None" ControlToValidate="txtPassword"
                                            runat="server" ErrorMessage="Password is required."></asp:RequiredFieldValidator>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="control-group">
                            <div class="col-md-4 distance-control">
                                <div class="col-md-5">
                                    <label class="control-label">Confirm New Password </label>
                                </div>
                                <div class="col-md-5" style="background: #fff none repeat scroll 0 0; padding-top: 6px; padding-bottom: 6px">
                                    <div class="controls">
                                        <asp:TextBox ID="txtConfirmPassword" runat="server" class="form-control" type="password" data-validate="required,ConPassWordValidate" ClientIDMode="Static" />
                                        <div style="display: none">
                                            <asp:TextBox ID="txtConfirmPasswordValidate" runat="server" class="form-control" Text="" />
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" Display="None" ControlToValidate="txtConfirmPasswordValidate"
                                                runat="server" ErrorMessage="Confirm password does not match."></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
                <div class="row popup-btn">
                    <div class="col-md-12 btn-edit">
                        <asp:LinkButton ID="btnSave" class="btn btn-defaul" runat="server" OnClick="btn_Save_ServerClick">
                            <img src="../Images/save.png" style="width: 18px; height: 18px" />
                            Save
                        </asp:LinkButton>
                        <div id="validation_dialog" style="display: none">
                            <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                        </div>
                        <asp:LinkButton ID="btnCancel" runat="server" class="btn btn-defaul" OnClientClick="onClose()">
                            <img src="../Images/delete.png" style="width: 18px; height: 18px" />
                            Cancel
                        </asp:LinkButton>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
